<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>消息通知 - 用户中心 - 拖拽式建站平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        :root {
            --sidebar-width: 240px;
            --header-height: 64px;
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f6f7;
            --card-bg: #ffffff;
            --text-primary: #18191c;
            --text-secondary: #61666d;
            --text-muted: #9499a0;
            --border-color: #e3e5e7;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* 顶部导航栏 */
        .header {
            height: var(--header-height);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid var(--border-color);
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
        }

        .sidebar-toggle {
            margin-right: 16px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 18px;
        }

        .logo {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }

        .header-right {
            display: flex;
            align-items: center;
        }

        .header-action {
            margin-left: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            position: relative;
        }

        .header-action:hover {
            color: var(--primary-color);
        }

        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger-color);
            color: white;
            font-size: 11px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .user-menu {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 12px;
        }

        /* 主内容区域 */
        .main-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* 侧边栏 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            transition: all 0.3s ease;
        }

        .sidebar-menu {
            padding: 16px 0;
        }

        .menu-title {
            padding: 10px 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .menu-item:hover {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .menu-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .menu-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 内容区域 */
        .content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
        }

        .page-actions .btn {
            margin-left: 10px;
        }

        /* 消息通知区域 */
        .messages-container {
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .messages-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .messages-title {
            font-size: 16px;
            font-weight: 500;
        }

        .messages-count {
            font-size: 14px;
            color: var(--text-muted);
        }

        /* 筛选和操作栏 */
        .messages-toolbar {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            align-items: center;
            background: #f9fafc;
        }

        .filter-tabs {
            display: flex;
            background: #f1f5f9;
            border-radius: 4px;
            padding: 2px;
        }

        .filter-tab {
            padding: 6px 12px;
            font-size: 13px;
            color: var(--text-secondary);
            cursor: pointer;
            border-radius: 3px;
            transition: all 0.3s ease;
        }

        .filter-tab.active {
            background: white;
            color: var(--primary-color);
            font-weight: 500;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .filter-tab:hover:not(.active) {
            background: rgba(255, 255, 255, 0.5);
        }

        .bulk-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .search-box {
            position: relative;
            margin-left: auto;
        }

        .search-input {
            padding: 8px 12px 8px 36px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            width: 200px;
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
        }

        /* 消息列表 */
        .messages-list {
            overflow-y: auto;
        }

        .message-item {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: flex-start;
            transition: background 0.3s ease;
            cursor: pointer;
        }

        .message-item:hover {
            background: rgba(52, 152, 219, 0.05);
        }

        .message-item:last-child {
            border-bottom: none;
        }

        .message-item.unread {
            background: rgba(52, 152, 219, 0.03);
        }

        .message-checkbox {
            margin-right: 12px;
            margin-top: 3px;
        }

        .message-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 16px;
            flex-shrink: 0;
        }

        .message-icon.system {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .message-icon.warning {
            background: rgba(243, 156, 18, 0.1);
            color: var(--warning-color);
        }

        .message-icon.success {
            background: rgba(39, 174, 96, 0.1);
            color: var(--success-color);
        }

        .message-icon.danger {
            background: rgba(231, 76, 60, 0.1);
            color: var(--danger-color);
        }

        .message-content {
            flex: 1;
        }

        .message-title {
            font-weight: 500;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
        }

        .message-title-text {
            flex: 1;
        }

        .message-badge {
            padding: 2px 6px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 500;
            margin-left: 8px;
        }

        .badge-system {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .badge-account {
            background: rgba(155, 89, 182, 0.1);
            color: #9b59b6;
        }

        .badge-update {
            background: rgba(39, 174, 96, 0.1);
            color: var(--success-color);
        }

        .badge-security {
            background: rgba(231, 76, 60, 0.1);
            color: var(--danger-color);
        }

        .message-desc {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            line-height: 1.5;
        }

        .message-meta {
            display: flex;
            align-items: center;
            font-size: 13px;
            color: var(--text-muted);
            flex-wrap: wrap;
        }

        .message-meta-item {
            display: flex;
            align-items: center;
            margin-right: 16px;
        }

        .message-meta-item i {
            margin-right: 4px;
        }

        .message-actions {
            display: flex;
            gap: 8px;
            margin-left: 16px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .message-item:hover .message-actions {
            opacity: 1;
        }

        .message-unread-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--primary-color);
            margin-left: 16px;
            flex-shrink: 0;
        }

        /* 空状态 */
        .empty-state {
            padding: 60px 20px;
            text-align: center;
            color: var(--text-muted);
        }

        .empty-state i {
            font-size: 64px;
            margin-bottom: 16px;
            color: #d1d5db;
        }

        .empty-state p {
            margin-bottom: 24px;
            font-size: 16px;
        }

        /* 分页控件 */
        .pagination {
            display: flex;
            justify-content: center;
            padding: 20px;
            border-top: 1px solid var(--border-color);
        }

        .pagination-item {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 4px;
            border-radius: 4px;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .pagination-item:hover {
            background: #f5f7fa;
            color: var(--primary-color);
        }

        .pagination-item.active {
            background: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
        }

        .pagination-item.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn i {
            margin-right: 6px;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .btn-outline:hover {
            background: #f5f7fa;
        }

        .btn-sm {
            padding: 4px 8px;
            font-size: 13px;
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            padding: 0;
            justify-content: center;
        }

        .btn-icon i {
            margin-right: 0;
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .sidebar {
                position: fixed;
                left: -var(--sidebar-width);
                top: var(--header-height);
                bottom: 0;
                z-index: 90;
            }

            .sidebar.open {
                left: 0;
            }

            .overlay {
                position: fixed;
                top: var(--header-height);
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 80;
                display: none;
            }

            .overlay.open {
                display: block;
            }
        }

        @media (max-width: 768px) {
            .messages-toolbar {
                flex-direction: column;
                align-items: stretch;
            }

            .search-box {
                width: 100%;
                margin-left: 0;
            }

            .search-input {
                width: 100%;
            }

            .message-item {
                flex-direction: column;
                align-items: flex-start;
            }

            .message-checkbox {
                margin-bottom: 12px;
            }

            .message-icon {
                margin-bottom: 12px;
            }

            .message-content {
                width: 100%;
                margin-bottom: 12px;
            }

            .message-actions {
                margin-left: 0;
                width: 100%;
                justify-content: flex-end;
                opacity: 1;
            }

            .message-unread-dot {
                margin-left: 0;
                margin-top: 12px;
            }

            .page-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .page-actions {
                margin-top: 16px;
                width: 100%;
                display: flex;
                justify-content: space-between;
            }

            .page-actions .btn {
                margin-left: 0;
                flex: 1;
                margin: 0 5px;
            }
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <div class="header">
        <div class="header-left">
            <div class="sidebar-toggle">
                <i class="fas fa-bars"></i>
            </div>
            <div class="logo">
                <i class="fas fa-puzzle-piece"></i>
                拖拽建站平台
            </div>
        </div>

        <div class="header-right">
            <div class="header-action">
                <i class="fas fa-bell"></i>
                <span class="badge">3</span>
            </div>

            <div class="header-action">
                <i class="fas fa-envelope"></i>
                <span class="badge">5</span>
            </div>

            <div class="user-menu">
                <span>张三</span>
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- 主内容区域 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-menu">
                <div class="menu-title">用户中心</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-user-circle"></i>
                    <span>个人信息</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-shield-alt"></i>
                    <span>账户安全</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-globe"></i>
                    <span>我的网站</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-file-alt"></i>
                    <span>我的页面</span>
                </a>

                <div class="menu-title">内容管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-newspaper"></i>
                    <span>我的文章</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-box"></i>
                    <span>我的产品</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-images"></i>
                    <span>我的媒体</span>
                </a>

                <div class="menu-title">交易管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-credit-card"></i>
                    <span>我的订单</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-money-bill-wave"></i>
                    <span>支付记录</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-gift"></i>
                    <span>优惠券</span>
                </a>

                <div class="menu-title">消息中心</div>
                <a href="#" class="menu-item active">
                    <i class="fas fa-bell"></i>
                    <span>消息通知</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-comments"></i>
                    <span>站内信</span>
                </a>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">
            <div class="page-header">
                <h1 class="page-title">消息通知</h1>
                <div class="page-actions">
                    <button class="btn btn-outline" id="markAllRead">
                        <i class="fas fa-check-double"></i> 全部已读
                    </button>
                    <button class="btn btn-outline" id="deleteSelected">
                        <i class="fas fa-trash"></i> 删除选中
                    </button>
                </div>
            </div>

            <!-- 消息通知区域 -->
            <div class="messages-container">
                <div class="messages-header">
                    <div class="messages-title">消息列表</div>
                    <div class="messages-count">共 12 条消息，5 条未读</div>
                </div>

                <!-- 筛选和操作栏 -->
                <div class="messages-toolbar">
                    <div class="filter-tabs">
                        <div class="filter-tab active">全部消息</div>
                        <div class="filter-tab">未读消息</div>
                        <div class="filter-tab">系统通知</div>
                        <div class="filter-tab">账户相关</div>
                    </div>

                    <div class="bulk-actions">
                        <input type="checkbox" id="selectAll">
                        <label for="selectAll">全选</label>
                    </div>

                    <div class="search-box">
                        <i class="fas fa-search search-icon"></i>
                        <input type="text" class="search-input" placeholder="搜索消息...">
                    </div>
                </div>

                <!-- 消息列表 -->
                <div class="messages-list">
                    <div class="message-item unread">
                        <input type="checkbox" class="message-checkbox">
                        <div class="message-icon system">
                            <i class="fas fa-cog"></i>
                        </div>
                        <div class="message-content">
                            <div class="message-title">
                                <div class="message-title-text">系统维护通知</div>
                                <span class="message-badge badge-system">系统</span>
                            </div>
                            <div class="message-desc">平台将于本周六凌晨2点至4点进行系统维护，期间可能会出现短暂的服务不可用情况，请您提前做好准备。</div>
                            <div class="message-meta">
                                <div class="message-meta-item">
                                    <i class="fas fa-clock"></i> 2小时前
                                </div>
                                <div class="message-meta-item">
                                    <i class="fas fa-database"></i> 系统通知
                                </div>
                            </div>
                        </div>
                        <div class="message-actions">
                            <button class="btn btn-icon btn-outline btn-sm" title="标记已读">
                                <i class="fas fa-check"></i>
                            </button>
                            <button class="btn btn-icon btn-outline btn-sm" title="删除">
                                <i class="fas fa-trash"></i>
                            </button>
                        </div>
                        <div class="message-unread-dot"></div>
                    </div>

                    <div class="message-item unread">
                        <input type="checkbox" class="message-checkbox">
                        <div class="message-icon success">
                            <i class="fas fa-check-circle"></i>
                        </div>
                        <div class="message-content">
                            <div class="message-title">
                                <div class="message-title-text">网站发布成功</div>
                                <span class="message-badge badge-update">更新</span>
                            </div>
                            <div class="message-desc">您的网站「科技公司官网」已成功发布并上线，现在可以通过您的域名访问了。</div>
                            <div class="message-meta">
                                <div class="message-meta-item">
                                    <i class="fas fa-clock"></i> 5小时前
                                </div>
                                <div class="message-meta-item">
                                    <i class="fas fa-globe"></i> 网站状态
                                </div>
                            </div>
                        </div>
                        <div class="message-actions">
                            <button class="btn btn-icon btn-outline btn-sm" title="标记已读">
                                <i class="fas fa-check"></i>
                            </button>
                            <button class="btn btn-icon btn-outline btn-sm" title="删除">
                                <i class="fas fa-trash"></i>
                            </button>
                        </div>
                        <div class="message-unread-dot"></div>
                    </div>

                    <div class="message-item">
                        <input type="checkbox" class="message-checkbox">
                        <div class="message-icon warning">
                            <i class="fas fa-exclamation-triangle"></i>
                        </div>
                        <div class="message-content">
                            <div class="message-title">
                                <div class="message-title-text">存储空间不足</div>
                                <span class="message-badge badge-account">账户</span>
                            </div>
                            <div class="message-desc">您的存储空间使用率已达到85%，建议清理不必要的文件或升级您的套餐以获得更多存储空间。</div>
                            <div class="message-meta">
                                <div class="message-meta-item">
                                    <i class="fas fa-clock"></i> 昨天 14:30
                                </div>
                                <div class="message-meta-item">
                                    <i class="fas fa-hdd"></i> 存储提醒
                                </div>
                            </div>
                        </div>
                        <div class="message-actions">
                            <button class="btn btn-icon btn-outline btn-sm" title="标记未读">
                                <i class="fas fa-envelope"></i>
                            </button>
                            <button class="btn btn-icon btn-outline btn-sm" title="删除">
                                <i class="fas fa-trash"></i>
                            </button>
                        </div>
                    </div>

                    <div class="message-item unread">
                        <input type="checkbox" class="message-checkbox">
                        <div class="message-icon danger">
                            <i class="fas fa-shield-alt"></i>
                        </div>
                        <div class="message-content">
                            <div class="message-title">
                                <div class="message-title-text">安全提醒：新设备登录</div>
                                <span class="message-badge badge-security">安全</span>
                            </div>
                            <div class="message-desc">检测到您的账户在新的设备上登录（位置：北京，设备：Chrome浏览器）。如果是您本人操作，请忽略此消息。</div>
                            <div class="message-meta">
                                <div class="message-meta-item">
                                    <i class="fas fa-clock"></i> 2023-09-01
                                </div>
                                <div class="message-meta-item">
                                    <i class="fas fa-lock"></i> 安全提醒
                                </div>
                            </div>
                        </div>
                        <div class="message-actions">
                            <button class="btn btn-icon btn-outline btn-sm" title="标记已读">
                                <i class="fas fa-check"></i>
                            </button>
                            <button class="btn btn-icon btn-outline btn-sm" title="删除">
                                <i class="fas fa-trash"></i>
                            </button>
                        </div>
                        <div class="message-unread-dot"></div>
                    </div>

                    <div class="message-item">
                        <input type="checkbox" class="message-checkbox">
                        <div class="message-icon system">
                            <i class="fas fa-gift"></i>
                        </div>
                        <div class="message-content">
                            <div class="message-title">
                                <div class="message-title-text">新功能上线：AI辅助设计</div>
                                <span class="message-badge badge-system">系统</span>
                            </div>
                            <div class="message-desc">我们很高兴地宣布，AI辅助设计功能现已上线！现在您可以使用AI生成页面布局和内容建议，大幅提高建站效率。</div>
                            <div class="message-meta">
                                <div class="message-meta-item">
                                    <i class="fas fa-clock"></i> 2023-08-28
                                </div>
                                <div class="message-meta-item">
                                    <i class="fas fa-rocket"></i> 产品更新
                                </div>
                            </div>
                        </div>
                        <div class="message-actions">
                            <button class="btn btn-icon btn-outline btn-sm" title="标记未读">
                                <i class="fas fa-envelope"></i>
                            </button>
                            <button class="btn btn-icon btn-outline btn-sm" title="删除">
                                <i class="fas fa-trash"></i>
                            </button>
                        </div>
                    </div>

                    <div class="message-item">
                        <input type="checkbox" class="message-checkbox">
                        <div class="message-icon success">
                            <i class="fas fa-money-bill-wave"></i>
                        </div>
                        <div class="message-content">
                            <div class="message-title">
                                <div class="message-title-text">付款成功</div>
                                <span class="message-badge badge-account">账户</span>
                            </div>
                            <div class="message-desc">您的企业版套餐续费已成功支付，金额：¥1299.00。感谢您的续订！</div>
                            <div class="message-meta">
                                <div class="message-meta-item">
                                    <i class="fas fa-clock"></i> 2023-08-25
                                </div>
                                <div class="message-meta-item">
                                    <i class="fas fa-credit-card"></i> 交易通知
                                </div>
                            </div>
                        </div>
                        <div class="message-actions">
                            <button class="btn btn-icon btn-outline btn-sm" title="标记未读">
                                <i class="fas fa-envelope"></i>
                            </button>
                            <button class="btn btn-icon btn-outline btn-sm" title="删除">
                                <i class="fas fa-trash"></i>
                            </button>
                        </div>
                    </div>
                </div>

                <!-- 分页控件 -->
                <div class="pagination">
                    <a href="#" class="pagination-item disabled">
                        <i class="fas fa-chevron-left"></i>
                    </a>
                    <a href="#" class="pagination-item active">1</a>
                    <a href="#" class="pagination-item">2</a>
                    <a href="#" class="pagination-item">3</a>
                    <a href="#" class="pagination-item">
                        <i class="fas fa-chevron-right"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <!-- 移动端遮罩层 -->
    <div class="overlay"></div>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 侧边栏切换
            const sidebarToggle = document.querySelector('.sidebar-toggle');
            const sidebar = document.querySelector('.sidebar');
            const overlay = document.querySelector('.overlay');

            sidebarToggle.addEventListener('click', function () {
                sidebar.classList.toggle('open');
                overlay.classList.toggle('open');
            });

            overlay.addEventListener('click', function () {
                sidebar.classList.remove('open');
                overlay.classList.remove('open');
            });

            // 导航菜单项点击
            const menuItems = document.querySelectorAll('.menu-item');

            menuItems.forEach(item => {
                item.addEventListener('click', function (e) {
                    e.preventDefault();
                    menuItems.forEach(i => i.classList.remove('active'));
                    this.classList.add('active');

                    // 这里可以添加加载对应页面内容的代码
                    const pageName = this.querySelector('span').textContent;
                    document.querySelector('.page-title').textContent = pageName;
                    console.log('切换到: ' + pageName);
                });
            });

            // 筛选选项卡切换
            const filterTabs = document.querySelectorAll('.filter-tab');

            filterTabs.forEach(tab => {
                tab.addEventListener('click', function () {
                    filterTabs.forEach(t => t.classList.remove('active'));
                    this.classList.add('active');

                    const filterType = this.textContent;
                    console.log('筛选类型: ' + filterType);

                    // 这里可以添加筛选消息的逻辑
                });
            });

            // 全选功能
            const selectAll = document.getElementById('selectAll');
            const messageCheckboxes = document.querySelectorAll('.message-checkbox');

            selectAll.addEventListener('change', function () {
                messageCheckboxes.forEach(checkbox => {
                    checkbox.checked = this.checked;
                });
            });

            // 标记单个消息为已读
            const markReadButtons = document.querySelectorAll('.message-actions .btn:first-child');

            markReadButtons.forEach(button => {
                button.addEventListener('click', function (e) {
                    e.stopPropagation();
                    const messageItem = this.closest('.message-item');
                    messageItem.classList.remove('unread');

                    const unreadDot = messageItem.querySelector('.message-unread-dot');
                    if (unreadDot) {
                        unreadDot.remove();
                    }

                    // 更新未读消息计数
                    updateUnreadCount();
                });
            });

            // 删除单个消息
            const deleteButtons = document.querySelectorAll('.message-actions .btn:last-child');

            deleteButtons.forEach(button => {
                button.addEventListener('click', function (e) {
                    e.stopPropagation();
                    const messageItem = this.closest('.message-item');
                    messageItem.remove();

                    // 更新消息计数
                    updateMessageCount();
                });
            });

            // 全部标记为已读
            const markAllReadBtn = document.getElementById('markAllRead');

            markAllReadBtn.addEventListener('click', function () {
                const unreadMessages = document.querySelectorAll('.message-item.unread');

                unreadMessages.forEach(message => {
                    message.classList.remove('unread');
                    const unreadDot = message.querySelector('.message-unread-dot');
                    if (unreadDot) {
                        unreadDot.remove();
                    }
                });

                // 更新未读消息计数
                updateUnreadCount();
            });

            // 删除选中消息
            const deleteSelectedBtn = document.getElementById('deleteSelected');

            deleteSelectedBtn.addEventListener('click', function () {
                const selectedMessages = document.querySelectorAll('.message-checkbox:checked');

                selectedMessages.forEach(checkbox => {
                    const messageItem = checkbox.closest('.message-item');
                    messageItem.remove();
                });

                // 更新消息计数
                updateMessageCount();

                // 取消全选
                selectAll.checked = false;
            });

            // 消息项点击查看详情
            const messageItems = document.querySelectorAll('.message-item');

            messageItems.forEach(item => {
                item.addEventListener('click', function (e) {
                    // 如果点击的是复选框或操作按钮，不触发详情查看
                    if (e.target.closest('.message-checkbox') || e.target.closest('.message-actions')) {
                        return;
                    }

                    const messageTitle = this.querySelector('.message-title-text').textContent;
                    console.log('查看消息详情: ' + messageTitle);

                    // 这里可以添加打开消息详情的逻辑
                    alert('打开消息详情: ' + messageTitle);
                });
            });

            // 更新未读消息计数
            function updateUnreadCount() {
                const unreadCount = document.querySelectorAll('.message-item.unread').length;
                const totalCount = document.querySelectorAll('.message-item').length;

                document.querySelector('.messages-count').textContent =
                    `共 ${totalCount} 条消息，${unreadCount} 条未读`;
            }

            // 更新消息总数
            function updateMessageCount() {
                const totalCount = document.querySelectorAll('.message-item').length;
                const unreadCount = document.querySelectorAll('.message-item.unread').length;

                document.querySelector('.messages-count').textContent =
                    `共 ${totalCount} 条消息，${unreadCount} 条未读`;
            }
        });
    </script>
</body>

</html>